<%--
  Created by IntelliJ IDEA.
  User: Wonderming
  Date: 2018/4/13
  Time: 14:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<link type="text/css" rel="stylesheet" href="css/common/common.css"/>

<div class="animated fadeInRight">
    <div class="wrapper wrapper-content ng-scope">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{ 'INDEFINITELY'| translate }}</h5>
                    </div>
                    <div class="ibox-content sk-loading" ng-controller="riskIndefinitelyCtrl">
                        <div class="sk-spinner sk-spinner-wave">
                            <div class="sk-rect1"></div>
                            <div class="sk-rect2"></div>
                            <div class="sk-rect3"></div>
                            <div class="sk-rect4"></div>
                            <div class="sk-rect5"></div>
                        </div>

                        <!-- 整个表单-->
                        <form name="myform" serializer="searchIndefinitely(data)">
                            <div class="row">
                                <!--类型-->
                                <div class="col-sm-6 col-md-4 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">类型：</span>
                                            <select id="indefinitelyType" name="indefinitelyType" class="form-control"
                                                    ng-model="indefinitely.refTypeName">
                                                <option value=""></option>
                                                <option value="通用">通用</option>
                                                <option value="收单机构">收单机构</option>
                                                <option value="商户">商户</option>
                                                <option value="域名">域名</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <!--名称-->
                                <div class="col-sm-6 col-md-4 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group" ng-show="indefinitely.refTypeName != '通用' && indefinitely.refTypeName != '商户' && indefinitely.refTypeName != '收单机构' && indefinitely.refTypeName != '域名'">
                                            <span class="input-group-addon">名称：</span>
                                            <select class="form-control" ng-model="indefinitely.refName">
                                                <option value="">{{ Name }}</option>
                                            </select>
                                        </div>
                                        <div class="input-group" ng-show="indefinitely.refTypeName == '通用'">
                                            <span class="input-group-addon">名称：</span>
                                            <select class="form-control" ng-model="indefinitely.refName">
                                                <option value="">{{ Name }}</option>
                                            </select>
                                        </div>
                                        <div class="input-group" ng-show="indefinitely.refTypeName == '商户'">
                                            <span class="input-group-addon">名称：</span>
                                            <select class="form-control" ng-model="indefinitely.refName" ng-options="x.name as x.id + '(' + x.name + ')' for x in init.merchant">
                                                <option value="">{{ Name }}</option>
                                            </select>
                                        </div>
                                        <div class="input-group" ng-show="indefinitely.refTypeName == '收单机构'">
                                            <span class="input-group-addon">名称：</span>
                                            <select class="form-control" ng-model="indefinitely.refName" ng-options="x.name as x.name for x in init.acquirer">
                                                <option value="">{{ Name }}</option>
                                            </select>
                                        </div>
                                        <div class="input-group" ng-show="indefinitely.refTypeName == '域名'">
                                            <span class="input-group-addon">名称：</span>
                                            <select class="form-control" ng-model="indefinitely.refName" ng-options="x.siteUrl as x.siteUrl for x in init.siteurl">
                                                <option value="">{{ Name }}</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <!--限制元素-->
                                <div class="col-sm-6 col-md-4 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">限制元素：</span>
                                            <select id="indefinitelyElement" name="indefinitelyElement"
                                                    class="form-control" ng-model="indefinitely.refLimitName"
                                                    ng-options="x.name as x.name for x in limitConstant">
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <!--状态-->
                                <div class="col-sm-6 col-md-4 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">状态：</span>
                                            <select id="indefinitelyStatus" name="indefinitelyStatus"
                                                    class="form-control" ng-model="indefinitely.statusName "
                                                    ng-options="x.name as x.name
                                                    for
                                                    x in statusConstant">
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <!--创建人-->
                                <div class="col-sm-6 col-md-4 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">创建人：</span>
                                            <input type="text" id="indefinitelyFounder" class="form-control"
                                                   name="indefinitelyFounder" ng-model="indefinitely.creator">
                                        </div>
                                    </div>
                                </div>
                                <!--最后修改人-->
                                <div class="col-sm-6 col-md-4 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">最后修改人：</span>
                                            <input type="text" id="indefinitelyModifier" class="form-control"
                                                   name="indefinitelyModifier" ng-model="indefinitely.modifier">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-3 col-lg-offset-3">
                                    <button type="submit" class="btn btn-sm btn-w-m btn-primary pull-right"
                                            ng-click="search(indefinitely)">
                                        查询
                                    </button>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <button class="btn btn-sm btn-w-m btn-info" ng-click="resetForm()">
                                        重置
                                    </button>
                                </div>
                            </div>
                        </form>

                        <!--分割线-->
                        <div class="hr-line-dashed"></div>

                        <button type="button" class="btn btn-sm btn-primary" ng-click="showModal(row,0)">新增</button>

                        <!-- 数据显示 ngtable-->
                        <div class="table-responsive">
                            <table ng-table="indefinitelyTable"
                                   class="table table-condensed table-striped table-hover table-bordered">
                                <tr ng-repeat="row in $data">
                                    <td class="text-center" style="line-height: 2" data-title="''">
                                        <input type="checkbox" id="indefinitelyCheckBoxID"
                                               ng-model="indefinitelyCheckBox"
                                               ng-click="collectSelectRows($event,row.id)"/>
                                    </td>
                                    <td class="text-center" style="line-height: 2"
                                        data-title="'名称'">
                                        {{row.refName}}
                                    </td>
                                    <td class="text-center" style="line-height: 2"
                                        data-title="'类型'">
                                        {{row.refTypeName}}
                                    </td>
                                    <td class="text-center" style="line-height: 2"
                                        data-title="'限制元素'">
                                        {{row.refLimitName}}
                                    </td>
                                    <td class="text-center" style="line-height: 2"
                                        data-title="'允许成功次数'">
                                        {{row.elementValue}}
                                    </td>
                                    <td class="text-center" style="line-height: 2"
                                        data-title="'允许失败次数'">
                                        {{row.elementFailValue}}
                                    </td>
                                    <td class="text-center" style="line-height: 2"
                                        data-title="'单位:小时'">
                                        {{row.ctyle}}
                                    </td>
                                    <td class="text-center" style="line-height: 2"
                                        data-title="'状态'">
                                        {{row.statusName}}
                                    </td>
                                    <td class="text-center" style="line-height: 2"
                                        data-title="'创建人'">
                                        {{row.creator}}
                                    </td>
                                    <td class="text-center" style="line-height: 2" data-title="'创建时间'">
                                        {{row.createTime | date: 'yyyy-MM-dd hh:mm:ss'}}
                                    </td>
                                    <td class="text-center" style="line-height: 2"
                                        data-title="'最后修改人'">
                                        {{row.modifier}}
                                    </td>
                                    <td class="text-center" style="line-height: 2" data-title="'修改时间'">
                                        {{row.modifyTime | date: 'yyyy-MM-dd hh:mm:ss'}}
                                    </td>
                                    <td class="text-center" style="line-height: 2;max-width: 100px;"
                                        data-title="'操作'">
                                        <risk-locked></risk-locked>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <my-pagination table-param="indefinitelyTable"></my-pagination>
                        <button class="btn btn-sm btn-primary del-btn marginTop-minus" ng-click="batchDel()"
                                ng-disabled="deleteFlag">删除
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
